/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package project.jpdftools.ui.actionlisteners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import project.jpdftools.ui.logic.JPDF;
import project.jpdftools.ui.logic.JPDFText;
import project.jpdftools.ui.FontPanel;

/**
 *
 * @author Mido
 */
public class FontPropertiesAction implements ActionListener {

    private JPDF component;

    public FontPropertiesAction(JPDF component) {
        super();
        this.component = component;
    }

    @Override
    public void actionPerformed(ActionEvent evt) {
        // make sure that the component is not visible
        if (FontPanel.IsComponentVisible() == false) {
            if (component instanceof JPDFText) {
                new FontPanel(component, ((JPDFText) component).getTextPane()).setVisible(true);
            }
        }
    }
}
